﻿<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Pragma" content="no-cache">
<link rel="STYLESHEET" type="text/css" id="SkinStyleSheet">
<title>WebNoteEditor</title>
<style type="text/css">
.Preview{*width:600px;*height:500px;zoom:30%;z-index:1;position:relative}
p{margin-top:1px;margin-bottom:1px}
*{font-size:9pt}
div.border{border: 1 #000000 solid;margin-top:5px;margin-left:5px;margin-right:5px;margin-bottom:2px;cursor:pointer}

a:visited {COLOR: #0000FF; TEXT-DECORATION: none;cursor:hand;font-size:9pt}
a:active {COLOR: #FF6600;TEXT-DECORATION: none;cursor:hand;font-size:9pt}
a:link {COLOR: #0000FF; TEXT-DECORATION: none;cursor:hand;font-size:9pt}
a:hover{ text-decoration: underline; cursor: hand; font-size: 9pt; color: #FF6600}
</style>
<script language="javascript" type="text/javascript" src="../script/windialog.js"></script>
<script Language="javascript">
window.onload=function()
{
	EditorWindow.renderWindowAsIE(window);
	ShowTPLTitle();
	AutoResizeDialogWindow();

}

var webTPLBasePath="../webtpl/";
var TPLCount=11;

function ShowAllTPL()
{
	var i,j,k,mmStep;
	
	mmStep=3;
	document.writeln("<table align='center'>");
		for (i=1;i<TPLCount;i=i+mmStep)
		{
			document.writeln("<tr>");
			for(j=0;j<mmStep;j++)
			{
				k=i+j;
				if (k>=TPLCount)
					break;
				document.writeln("<td width=''><div class='border'><iframe id='TPL"+k+"' src='"+webTPLBasePath+"tpl"+k+".htm' class='Preview' frameborder='0' scrolling='auto'></iframe></div><p align='center'><a id='txt"+k+"' href='#'></a></p></td>");
			}
			document.writeln("<tr>");
		}
	document.writeln("</table>");
}


function ShowTPLTitle()
{
	var i,tempObj;
	for (i=1;i<TPLCount;i++)
	{
		tempObj=document.getElementById("txt"+i);
		tempObj.innerHTML=document.getElementById("TPL"+i).contentWindow.document.title;

		tempObj.title="使用模板【"+tempObj.innerText+"】";
		tempObj.parentElement.setAttribute("WebNote_Index",i);
		tempObj.onclick=__selectWebTPL;
		
		tempObj=null;
	}
}

function __selectWebTPL()
{
	var sIndex,elems,i;
	//var event=(window.parent.event?window.parent.event:event);
	sIndex=this.parentElement.getAttribute("WebNote_Index");
	elems=document.getElementById("TPL"+sIndex).contentWindow.document.getElementsByTagName("img")
	for (i=0;i<elems.length;i++)
		elems[i].src=elems[i].src;

	EditorWindow.setHTML(document.getElementById("TPL"+sIndex).contentWindow.document.body.innerHTML);

	EditorWindow.__showGuide();
	window.close();
}
</script>
</head>

<body >
<div style="overflow:auto;height:380px">
<script language="javascript" type="text/javascript">
ShowAllTPL();
</script>
</div>
</body>

</html>
